<?php

class CepController extends Controller{

	public function __construct(){
		header('Access-Control-Allow-Origin: *');
		//header('Access-Control-Allow-Origin: <http://rkphp>');
	}

	/**
	 * @url GET rest/cep/get
	 * @protected
	 */
	public function getEnderecoPorCep() {
		
		//return array(Uri::getAuthUser(), Uri::getAuthPw(), Uri::getGET(), $_SERVER);
		
		$cep = Uri::getGET('cep');
		$model = new CepModel();
		$result = $model->getEnderecoPorCep($cep);
		
		if(!is_null($result)){
			return $result;
		}
		return FALSE;
	}
}

?>